Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

174
Views
La ruta hoja coincidente en la ubicación "/perfil/1" no tiene ningún elemento. Reaccionar enrutador V6

He escrito un componente

 import { useState, useEffect } from "react"; import styled from "styled-components"; import { useParams } from "react-router-dom"; import colors from "../../utils/styles/colors"; import { ThemeContext } from "../../utils/contexte"; function Profile() { const { id: queryId } = useParams(); const [profileData, setProfileData] = useState({}); useEffect(() => { fetch(`http://localhost:8000/freelance?id=${queryId}`) .then((response) => response.json()) .then((jsonResponse) => { setProfileData(jsonResponse?.freelaneData); }); }, [queryId]); const { picture, name, location, tjm, job, skills, available, id } = profileData;

Estoy usando esta ruta en mi index.js:

 <Route path="/profile/:id" render={(props) => <Profile {...props} />}

Pero, la advertencia que recibo es:

index.tsx:25 La ruta hoja coincidente en la ubicación "/profile/1" no tiene ningún elemento. Esto significa que generará un valor nulo de forma predeterminada, lo que dará como resultado una página "vacía".

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

<Route path="/profile/:id" render={(props) => <Profile {...props} />}

Usa esto en lugar de

 <Route path="/profile/:id" element={<Profile props = {props} />} />
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!